// pages/02admin/16report/report.js
var app = getApp()
var co = require('../../js/common.js')
Page({

   /**
    * 页面的初始数据
    */
   data: {
      orderList: '',
      date: '选择时间',
   },
   onLoad: function (opt) {
      var date = co.getNowFormatDate()
      var param = {
         shop_id: app.globalData.shopInfo.Biz_ID,
         date: date
      }
      var t = this
      app.getNetData('order/mg/statement', param, function (res) {
         console.log('#########res', res)
         t.setData({
            orderList: res.data,
            date: date
         })
      })
   },

   bindDateChange: function (e) {
      var t = this
      var e_v = e.detail.value
      t.setData({ date: e_v })

      var param = {
         shop_id: app.globalData.shopInfo.Biz_ID,
         date: e_v
      }
      app.getNetData('order/mg/statement', param, function (res) {
         console.log('#########res', res)
         t.setData({ orderList: res.data })
      })
   },
   /**
    * 页面相关事件处理函数--监听用户下拉动作
    */
   onPullDownRefresh: function () {

   },

   /**
    * 页面上拉触底事件的处理函数
    */
   onReachBottom: function () {

   },

   /**
    * 用户点击右上角分享
    */
   onShareAppMessage: function () {

   }
})